package biz.obake.team.touchprotector.ui;

import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.appcompat.app.b;
import biz.obake.team.touchprotector.R;
import biz.obake.team.touchprotector.g.a;

public class Tab_Safety extends a {
    /* access modifiers changed from: private */
    public boolean mIgnorePrefChanged = false;

    private void confirmDisableUnlockUsb() {
        prefSwitch("unlock_usb", true);
        b.a aVar = new b.a(getActivity(), 2131689481);
        aVar.s(R.string.ui_tab_safety_dialog_unlock_usb_title);
        aVar.g(R.string.ui_tab_safety_dialog_unlock_usb_message);
        aVar.j(R.string.ui_tab_safety_dialog_unlock_usb_negative, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialogInterface, int i) {
            }
        });
        aVar.o(R.string.ui_tab_safety_dialog_unlock_usb_positive, new DialogInterface.OnClickListener() {
            public void onClick(DialogInterface dialogInterface, int i) {
                boolean unused = Tab_Safety.this.mIgnorePrefChanged = true;
                Tab_Safety.this.prefSwitch("unlock_usb", false);
                boolean unused2 = Tab_Safety.this.mIgnorePrefChanged = false;
            }
        });
        aVar.a().show();
    }

    public void onCreatePreferences(Bundle bundle, String str) {
        setPreferencesFromResource(R.xml.ui_tab_safety, str);
    }

    /* access modifiers changed from: protected */
    public void onPrefChanged(SharedPreferences sharedPreferences, String str) {
        if (!this.mIgnorePrefChanged) {
            if ("unlock_usb".equals(str) && !a.g("unlock_usb")) {
                confirmDisableUnlockUsb();
            }
            if (str.equals("unlock_on_screen_off") && a.g("unlock_on_screen_off")) {
                prefSwitch("lock_on_screen_off", false);
            }
            if (str.equals("lock_on_screen_off") && a.g("lock_on_screen_off")) {
                prefSwitch("unlock_on_screen_off", false);
            }
        }
    }

    /* access modifiers changed from: protected */
    public void onUpdateDisplay() {
        prefUpdateListSummary("five_touches_action");
    }
}
